002 how i do it (part 1)
大家好,欢迎来到我们的第一个奇迹项目,这将是本课程的项目 10。
Hey Guys welcome to our first project of wonder where this will be Project 10 for the course.
我们将经历并完成与 Easy Builder 所做的基本上相同的项目。
And we're going to be going through and doing basically all the same projects that we did for easy builder.
但最后我们还将再做一次数据采集。
But we're also going to be doing one more for data acquisition at the end.
我们也将在一天内完成所有这些工作。
We're just going to be doing them all in one day where as well.
因此,您将有几个非常相似的大型项目,您可以在本课程结束时向其他人展示这些项目,但您将能够在多种技术中展示所有这些知识。
So you're going to have a couple of very similar very big projects that you can show somebody by the end of this course but you'll be able to demonstrate all of that knowledge in multiple technologies.
非常令人印象深刻的东西。
So very impressive stuff.
首先,我已经获得了博士学位。
For starters I've already got my Ph.D.
程序在模拟器上运行。
program running on emulate.
所以我要直接跳到一个地方,我们将开始建立我们的新项目。
So I'm just going to go right ahead and jump into one where and we're going to start setting up our new project.
因此,让我们继续单击这个新项目按钮。
So let's go ahead and click on this new project button.
我将继续称之为 W.W.
I'm going to go ahead and just call this W.W.
我将接受它想要存储所有内容的默认位置。
and I will accept the default location of where it wants to store everything.
我的目标平台是 Windows。
My target platform is going to be Windows.
这将是一个轻量级的界面。
And this is going to be a light interface.
然后我就可以继续并点击“确定”。
And at that I can go ahead and hit OK.
我要在这里修改的唯一一件事是,对于这个项目,我将继续使用比我的本机屏幕分辨率低得多的分辨率。
And the only thing I'm going to modify in here is that for this project I'm going to go ahead and use a much lower resolution than my native screen resolution.
现在我到底为什么要这么做。
Now why on earth would I want to do that.
我的电脑上有全高清屏幕,但不是世界上每个人都有。
Well I've got a full HD screen on my computer but not everybody in the world does.
我希望能够与大家分享这个项目。
And I want to be able to share this project with all of you.
您知道有些人拥有四台显示器,而其他人则拥有 720 P 分辨率的显示器,甚至可能有比这更简单的显示器。
And you know some people out there have four monitors and then there are other people out there that have you know monitors that are you know 720 P resolution and possibly even some simpler than that.
因此,我不会想当然地认为每个人都拥有最新、最好的技术。
So I'm not going to take it for granted that everybody's got the latest and greatest technology out there.
因此,我将继续将其设置为较低的值,因为我希望能够与每个人分享它,并且我希望您能够运行它,而不必来回滚动以查看所有内容,并且永远不会真正看到能够同时看到屏幕。
So I'm going to go ahead and set this at something substantially lower because I want to be able to share this with everybody and I want you to be able to run this without having to scroll back and forth to see everything and never really being able to see the screen all at once.
这又是对我们用户体验的考虑。
Again this is a consideration of us user experience.
我的用户没有与我相同的屏幕分辨率,如果他们尝试运行它并与其交互并查看它,他们将获得非常糟糕的体验,并且他们必须不断来回和向上滚动向下查看屏幕上的所有内容。
My users don't have the same screen resolution as I do and they're going to have a pretty bad experience if they're trying to run this and interact with it and see it and they have to keep scrolling back and forth and up and down to see everything on the screen.
所以我们将采用 700 x 700,我会点击“确定”。
So we're going to go with 700 by 700 and I'll hit OK on that.
它将在后台进行思考并加载子项目。
And it's going to do its thinking in the background and get a subprojects loaded.
看来我们关系不错啊
Looks like we're good.
然后我将继续设置我的来访。
And at that I'm going to go ahead and set up my comes.
因此,这有两个驱动程序添加和删除驱动程序,我将使用我的 ab Kate 驱动程序选择它并单击“确定”。
So this come in two drivers add and remove drivers and I'm going to take my ab Kate driver select that and hit OK.
现在我将扩展我的驱动程序。
Now I'll expand my drivers out.
右键单击 AB Katie 并进行设置,我们要确保这个东西正在通信。
Right click on AB Katie and take settings and we want to make sure that this thing is communicating on come for.
这是使用 SLC 500 人们查看系列和 CRC 错误检查,以便我知道我的通信已准备就绪。
And this is using the SLC 500 people see family and CRC error check so that I know I've got my communications ready to go.
我可以继续点击“确定”并跳出那里,然后我将来到这里进行图形处理。
I can go ahead and hit OK and jump out of there and then I'm going to come over here to graphics.
让我们继续,右键单击屏幕并插入,我将继续并称其为欢迎,因为这将是我的欢迎屏幕。
Let's go ahead and right click on screen and insert and I will just go ahead and call this welcome because this is going to be my welcome screen.
我的所有屏幕都将采用 700 700 的默认分辨率,我可以继续点击“确定”,因为我没有看到任何其他需要更改的内容。
It's going to have my 700 700 default resolution for all of my screens and I can go ahead and hit OK on that because I don't see anything else in there that I need to change.
现在,我的屏幕比我的原始分辨率小得多,但每个人都能看到它,它只会限制我一次在屏幕上执行的操作。
Now I have a screen that is much smaller than my native resolution but it's one that everyone's going to be able to see it's just going to constrain what I'm able to do a little bit on the screen at once.
好消息是,如果您有更大的分辨率,您将不会受到相同的限制。
The good news is if you have bigger resolution you won't have the same constraints.
所以你的项目应该比我的更容易。
So your projects should be even easier than mine.
现在我已经知道了我想在主屏幕上显示什么。
So now that I've got that what do I want to show on my main screen.
在开始绘制屏幕并在各处放置控件之前,让我们开始考虑标签。
Let's start thinking about tags before I start drawing screens and dropping controls everywhere.
有人进入全局并想要进入项目标签。
Someone come into global and want to go into Project tags.
我只是要进行数据视图,在这里我有一种不同的方法来创建标签,而不是使用小界面。
And I'm just going to take a data view and here I've got a different way to create tags instead of using the little interface.
我实际上可以使用这张表,并且可以在此处创建我的标签。
I can actually use kind of this sheet and I can create my tags in here.
太酷了。
That's pretty cool.
我将开始创建跑步指标,我知道这将是一个布尔值,然后我将创建 B.-W 跑步指标。
I'm going to start and I'm going to create my indicator for running and I know that that is going to be a boolean then I'm going to have my indicator for B.-W running.
这告诉我们,如果我们有反洗,我们将把它作为布尔值,然后我将有我的不是指标,而是反洗指标待定。
That tells us if we've got a backwash we're going to have that as a boolean then I'm going to have my not indicator but indicator of backwash pending.
现在,由于我们不必立即将地址放入标签中,所以有一件好事要说,它确实加快了速度。
Now since we don't have to put the addresses in the tags right now there is one nice thing to be said is that it really speeds things up a little bit.
每当您创建标签并最初将它们布置在屏幕上使用时,我们都会有一个 P1 指示器。
Whenever you're creating your tags and just laying them out initially to use on the screens then we're going to have an indicator for P1.
让我们继续将其称为布尔值。
Let's go ahead and call that a boolean.
我们将有一个压差,我现在不会设置所有标签。
We're going to have a differential pressure and I'm not going to set up all of my tags right now.
我只想设置一些基本的东西,以便我可以在主屏幕上继续操作,然后让我们继续测量水箱液位。
I just want to get some basic stuff set up so that I can get going on my main screen and let's go ahead and take a tank level.
好的。
All right.
我还想在第一个屏幕上看到什么。
And what else am I going to want on that first screen.
好吧,我现在什么都没想,尽管我可能忘记了一些事情。
Well I'm not thinking of anything right now although I'm probably forgetting something.
但现在我认为这应该是好的。
But for now I think that should be good.
哦,你知道吗。
And oh you know what.
我知道我忘记了什么,我需要系统启动和停止按钮。
I know what I'm forgetting I need systems start and stop buttons.
所以 P.B.
So P.B.
我就将这称为开始,然后我将采取 P.B.
and I'll just call this start and then I'll take a P.B.
停止应该这样做,然后我们将它们设置为布尔值。
stop that should do it and then we'll set those up as booleans.
所以我已经开始了大量的标签,我只是还没有真正将它们添加到地址中,我会继续稍后再做,因为现在我没有心情写一堆地址所以我要继续单击 Savol,我会将其保持打开状态,因为谁知道我最终可能会使用它。
So I've already got a ton of tags started I just haven't actually added them in with the addresses yet and I'll go ahead and do that later because right now I am just not in the mood to write a bunch of addresses so I'm going to go ahead and click Savol and I'll leave that open because who knows I'll probably end up using it.
这也被保存为屏幕。
And this is saved as a screen too.
我真的对这个名字并不感兴趣,但实际上它看起来甚至没有保存,也许是因为我屏幕上没有任何东西。
And I really am not crazy about that name but actually it looks like it didn't even save maybe because I don't have anything on the screen.
因此,让我们首先画一个按钮,然后我将让我的系统开始运行。
So let's start by going ahead and drawing a pushbutton and I'm going to get my system start going.
因此,有一个基本文本,该按钮应该对我来说是完美的,我将继续复制和粘贴,我将在此处再引用一个,我可能只是将它们拖到某个地方,因为我知道我不是希望它们就在我的左上角。
So there's a basic text about and that button should be about perfect for me and I'll go ahead and copy and paste and I'll quote one more right down here and I might just drag these off somewhere because I know I'm not going to want them right up in my top left corner.
但让我暂时把它们排除在外。
But let me just get them kind of out of the way for the time being.
让我们继续开始这个,所以我们将插入一个标签。
And let's go ahead and start this one so we're going to insert a tag.
只寻找我的布尔值,这将是我的系统启动。
Look for just my booleans and this is going to be my system start.
然后我可以再次启动配置调用。
Then I can hit config call that start again.
当按钮按下时,我仍然希望它说开始,但我会给它不同的颜色。
And when the button is down I still want it to say start but I will give it a different color.
一种非常非常深的绿色,也许不是那么暗,但使它可见。
Kind of a really really dark green maybe not quite that dark but something to make it visible.
除此之外,当我们上升时,我们写一个值 0;当我们下降时,我们写一个值 1,这正是我们想要这个东西做的。
And other than that we're writing a value of zero when we're up we're writing a value of one when we're down which is exactly what we want this thing to do.
我们的英雄对此表示同意。
And our hero okay on that.
确保按钮类型为瞬时且常开。
Make sure that the type of button is momentary and it's normally open.
我对这一切都很满意。
I'm happy with every single bit of that.
然后为了安全起见,我确实希望有人必须登录才能执行此操作,我希望他们拥有基本级别的许可,允许他们运行此操作,但我暂时不打算设置我的安全性。
And then for security I do want somebody to have to be logged in in order to do this I want them to have a basic level of clearance that allows them to run this but I'm not going to set my security just yet.
稍后每当我设置安全性时,我都会继续进行设置。
I'll go ahead and set that later whenever I'm setting up my security.
所以现在我想我会保持原样,然后我会来这里处理另一个按钮。
So for now I think I'll leave that as is and I'll come in here and work on this other button.
现在我要配置这个。
Now this one I'm going to configure.
我希望它能正常阅读,因为这将是我的停止按钮。
I want it to be read normally because this is going to be my stop button.
因此,对于较深的颜色,我会选择这种看起来非常恶心的红色。
So for a darker color I'll just pick this really gross looking kind of red.
我不知道你会怎么称呼这种颜色,但它肯定会告诉操作员,当他按下按钮时,他已经做了某件事。
I don't know what you'd call that color but it'll certainly tell the operator that he's done something when he pushes the button.
然后我们将使用停止标签对其进行设置。
Then we'll set that up with a stop label.
同样在这里。
Same over here.
否则一切仍然会完全一样地工作,这没关系。
Otherwise everything will still work exactly the same and that's OK on that.
并在我们的列表中设置我们的停止按钮标签。
And set up our stop button tag right there out of our list.
我们不会在这些瞬间使用指标,其他一切看起来都很棒。
We're not going to use indicators on these momentary everything else looks great.
所以我可以关闭这里,现在我已经有了按钮,我需要一种方法来知道我的系统是否正在运行。
So I can close out of here and now that I've got my buttons I need a way to know whether or not my system is running.
因此,让我们来到顶部,我将收到一条明智的消息,我将把它拉下来,我将在那个大的地方画出它,让我们双击它并弄清楚如何设置它事情发生了。
So let's come up here to the top and I'm going to take a smart message and I'm going to pull that down and I'm going to draw that about that big let's double click on that and figure out how to set this thing up.
所以我想要一条具有值类型的智能消息。
So I want a smart message with a value type.
我将继续为该值取一个布尔值,然后读取标签。
I'll go ahead and take a Boolean for that then read tag.
我将把它当作我的系统正在运行。
I'm going to take this as my system running.
好的。
OK.
那我的字体呢?
And what about my font.
我想要这样。
I want this to be.
我可能会选择 Colibri 之类的东西。
I'll take something like maybe Colibri.
听起来很好。
That sounds good.
我将把它设置为粗体和大小。
And I will have this as bold and size.
让我们继续将其增加到 12。
Let's go ahead and bump this up to 12.
至于字体颜色,我暂时保留黑色,然后单击“确定”。
And as for font color I'll leave that black for the time being and hit OK.
然后我的消息呢?
And then what about my messages.
嗯,看起来我在这里有更多的字体控制。
Well it looks like I've got some more font control in here.
因此,让我们开始使用此格式而不是 R-OH 格式。
So let's start playing with this instead of R-OH format.
我要看看我是否可以控制我的格式,并且我的零消息将是系统离线的。
I'm going to see if I can take control of my formatting and my zero message will be system off line.
如果我真的在运行,我想继续说系统运行非常简单,足以设置消息。
And if I am actually running I want to go ahead and say system running so simple enough to set up the messages.
那我的文字颜色呢?
And what about my text colors.
嗯,我想我喜欢使用 read 来离线,使用 green 来运行。
Well I think I like using read for off line and green for running.
这是我典型的文本背景。
That's kind of typical of me text background.
如果我愿意的话,我可以给它一个背景颜色。
I can give this a background color if I want.
在这种情况下,我真的不希望这样。
In this case I really don't want that.
我想就这样保留它,然后我可以设置文本闪烁和其他一些前景背景。
I want to leave it just like that and then I can set up text blinking and some other foreground background.
现在我将保持原样。
And now I'm going to leave that exactly as it is.
所以这应该很好。
So that should be good.
至少每当我们测试这个东西时你就会发现。
At least you'll find out whenever we test this thing.
边境等待。
Border wait.
我确实认为我会继续在周围留下一个小边框,我认为它不会太俗气。
I do think I'll go ahead and leave a small border around that I don't think it'll be anything too tacky.
边境等待,我想我会留下那个。
Border wait I think I'll leave that one.
我们应该保持良好的一致性。
And we should be good alignment.
我将继续将其设置在中心,让我们采取它。
I'll go ahead and set that at center and let's take that.
所以看起来系统运行得相当不错。
So that looks pretty decent system running.
然后我就可以继续复制它。
And then I can go ahead and copy that.
然后,当我创建另一个并将其放在这里时,这个将用于告诉我们是否正在运行反冲洗。
And then when I create another one and put it right here and this one is going to be used to tell us if we're running a backwash.
因此,让我们继续插入反冲洗运行的标签,我们已经设置了所有颜色。
So let's go ahead insert the tag of backwash running and we've already got everything set up my colors.
我不想要绿色和红色。
I don't want as green and red.
首先,这将代表正向流与反冲洗和反冲洗。
So first of all this is going to represent forward flow versus backwash and backwash.
我认为我们的黄色设置可能有点难以在屏幕上看到,所以我可能会这样做。
I think our set up as yellow might be a little hard to see on the screen so I might just do this.
我将反洗的颜色设置为黑色前景和黄色背景,然后对于正向流动,我将采用蓝色前景色,并将背景色保留为白色。
I will set the color up for backwash as a foreground of black and a background of yellow and then for forward flow I will take a foreground color of blue and I'll leave my background color white.
所以这应该是反冲洗的一个很好的指示。
So that should be a really good indication of backwash.
但没关系,其他一切就这样吧。
But it's OK and take everything else the way it is.
好的。
OK.
还有哦。
And ooh.
如果这就是它显示我的颜色的方式,如果它只是在文本上显示背景颜色并且它没有填充整个框。
If that's the way that it shows my color if it just shows the background color right there on the text and it doesn't fill the whole box.
我认为这实际上有点丑陋,所以也许我会重新考虑这一点。
I think that's kind of ugly actually so maybe I'm going to rethink that.
为什么我们不回到这里,我们不使用文本背景,而是使用矩形背景,也许只是为了保持相似。
Why don't we come back in the here and let's not use the text background rather than that let's use the rectangle background and maybe just to keep it similar.
我们将使用文本背景和矩形背景,这样就可以了。
We'll use the text background and the rectangle background so that's OK.
现在这就是我想要的样子。
Now that's what I want that to look like.
如果我在逆流中,我希望整个东西都变黄。
I want that whole thing to turn yellow if I'm in a backwash.
那挺好的。
That's good.
我想我可以处理这个问题。
I think I can handle that.
我仍然需要在这里放一些显示器来展示我的过滤器和我的水箱。
I still need to put some displays on here to show my filter and to show my tank.
但现在我要继续休息一下,这样这个讲座就不会持续太久,我们将在下一部分中回来,我们会尽力完成这个讲座。
But for right now I'm going to go ahead and take a break so that this lecture doesn't run too long and we'll come back in the next part and we'll try to finish this up.
那么看吧。
So see then.
干杯。
Cheers.